package org.feng.feign;

import org.feng.base.entity.Result;
import org.feng.vo.EmailMessageVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 冯帅
 * @des TODO
 * @date 2022/2/7 9:07
 * @email 15612509687@163.com
 */
@FeignClient(value = "sms", fallback = EmailFallBackHandler.class, contextId = "email")
public interface EmailFeign {
    /**
     * 发送邮件
     *
     * @param emailMessage
     * @return
     */
    @PostMapping("send_email")
    Result<Boolean> sendEmail(@RequestBody EmailMessageVO emailMessage);


    /**
     * 发送带附件的邮件
     *
     * @param emailMessage
     * @param file
     * @return
     */
    @PostMapping("send_email_with_attach")
    Result<Boolean> sendEmailWithAttach(@RequestBody EmailMessageVO emailMessage, @RequestParam("file") MultipartFile[] file);
}
